#!/usr/bin/env python3
"""
Setup script for Fortran Code Commentator

A professional automated code commenting system for Fortran codebases,
with specialized support for scientific computing applications.
"""

from setuptools import setup, find_packages
from pathlib import Path

# Read long description from README
long_description = ""
readme_path = Path(__file__).parent / "README.md"
if readme_path.exists():
    with open(readme_path, "r", encoding="utf-8") as f:
        long_description = f.read()

# Read version
version = "1.0.0"
version_file = Path(__file__).parent / "fortran_commentator" / "__version__.py"
if version_file.exists():
    exec(open(version_file).read())

# Read requirements
install_requires = [
    "requests>=2.25.0",
    "pyyaml>=5.4.0", 
    "python-dotenv>=0.19.0",
    "pathlib2>=2.3.0;python_version<'3.4'",
    "dataclasses>=0.6;python_version<'3.7'",
    "typing-extensions>=3.7.4;python_version<'3.8'",
]

extras_require = {
    "dev": [
        "pytest>=6.0.0",
        "pytest-cov>=2.10.0",
        "black>=21.0.0",
        "flake8>=3.8.0",
        "mypy>=0.812",
        "pre-commit>=2.10.0",
    ],
    "docs": [
        "sphinx>=3.5.0",
        "sphinx-rtd-theme>=0.5.0",
        "myst-parser>=0.13.0",
    ],
}

setup(
    name="fortran-code-commentator",
    version=version,
    author="GSI Development Team",
    author_email="gsi-dev@noaa.gov",
    description="Automated code commenting system for Fortran codebases",
    long_description=long_description,
    long_description_content_type="text/markdown",
    url="https://github.com/NOAA-GSI/fortran-code-commentator",
    project_urls={
        "Bug Tracker": "https://github.com/NOAA-GSI/fortran-code-commentator/issues",
        "Documentation": "https://fortran-code-commentator.readthedocs.io/",
        "Source Code": "https://github.com/NOAA-GSI/fortran-code-commentator",
    },
    packages=find_packages(),
    classifiers=[
        "Development Status :: 4 - Beta",
        "Intended Audience :: Developers",
        "Intended Audience :: Science/Research",
        "Topic :: Software Development :: Documentation",
        "Topic :: Scientific/Engineering :: Atmospheric Science",
        "License :: OSI Approved :: Apache Software License",
        "Programming Language :: Python :: 3",
        "Programming Language :: Python :: 3.7",
        "Programming Language :: Python :: 3.8",
        "Programming Language :: Python :: 3.9",
        "Programming Language :: Python :: 3.10",
        "Programming Language :: Python :: 3.11",
        "Programming Language :: Fortran",
        "Operating System :: OS Independent",
    ],
    python_requires=">=3.7",
    install_requires=install_requires,
    extras_require=extras_require,
    entry_points={
        "console_scripts": [
            "fortran-commentator=fortran_commentator.cli.main:main",
            "fc-comment=fortran_commentator.cli.main:main",
        ],
    },
    include_package_data=True,
    package_data={
        "fortran_commentator": [
            "config/*.md",
            "config/*.yaml",
            "templates/*.md",
        ],
    },
    zip_safe=False,
    keywords="fortran, documentation, comments, code-analysis, scientific-computing",
)